package pl.eurobank.dev.model;

import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "client_has_invest_fund_unit")
public class ClientHasInvestFundUnit {

	private int id;
	private Client client;
	private InvestmentFundUnitType investmentFundUnitType;
	private int investmentFundNumber;
	private float amount;
	
	@SequenceGenerator(name = "client_invest_fund_unit_seq", sequenceName = "client_invest_fund_unit_seq")
	@Id
	@GeneratedValue(generator = "client_invest_fund_unit_seq")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "client_id", nullable = false)	
	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "investment_fund_unit_type_id", nullable = false)
	public InvestmentFundUnitType getinvestmentFundUnitType() {
		return investmentFundUnitType;
	}

	public void setInvestmentFundUnitType(InvestmentFundUnitType investmentFundUnitType) {
		this.investmentFundUnitType = investmentFundUnitType;
	}

	@Column(name = "invest_fund_number", nullable = false)
	public int getInvestmentFundNumber() {
		return investmentFundNumber;
	}

	public void setInvestmentFundNumber(int investmentFundNumber) {
		this.investmentFundNumber = investmentFundNumber;
	}

	@Column(name = "amount", nullable = false)
	public float getAmount() {
		return amount;
	}

	public void setAmount(float amount) {
		this.amount = amount;
	}
	
	
}
